Current detecting circuit

ABSTRACT

In a current detecting circuit, a virtual earth generating circuit  7  generates a low voltage V SS  lower by a predetermined potential difference than a battery voltage V BT  outputted from anon-vehicle battery  1 . A CPU  5  operates while the low voltage V SS  is used as an earth potential and the voltage V BT  higher by the predetermined voltage value than the low voltage V SS  is used as a power-supply voltage. A/D conversion input terminals  53  and  54  of the CPU  5  are connected to the battery  1  side of a current detecting resistor  3  and the load  4  side of the resistor  3 . The voltages on the battery  1  side and the load  4  side of the resistor  3  to be inputted to the terminals  53  and  54  are detected by an A/D converter 60. A load current I LD  is calculated based on the detected results and the resistor  3  resistance.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a current detecting circuit fordetecting a load current supplied from a power supply portion to a load.

[0003] 2. Description of the Related Art

[0004] In a current supply circuit for supplying a load current from apower supply portion to a load when switching means is turned on, fusehas been heretofore widely used as protection means against anovercurrent. The fuse is inserted in series to the circuit so that, whenan overcurrent flows, the fuse is blown to cut off the circuit. Hence,the fuse has an advantage of being capable of protecting the circuitsurely. However, when an overcurrent flows to make the fuse blown out,the circuit cannot be restored unless the blown fuse is exchanged for anew one. There is therefore a problem that much labor is required forrestoration of the circuit. Particularly in a vehicle, themodularization of the current supply circuit has been advanced in recentyears and such fuse has been incorporated in a module. To exchange anold fuse for a new one, the old fuse had to be taken out first from theinside of the module and the new fuse was then incorporated in themodule. Hence, the efficiency in the work of exchanging the fuse for anew one was very low.

[0005] Therefore, a configuration to dispense with the fuse has beendiscussed as follows. That is, in the configuration, the current flowingin the current supply circuit is monitored so that, when the level ofthe current deviates from a normal range, the switching means is turnedoff to cut off the circuit. A current detecting circuit for detecting aload current accurately is required for achieving the configuration.

[0006] A circuit as shown in FIG. 7 is known as the current detectingcircuit of this type. In the circuit shown in FIG. 7, a high-precisionlow resistor 103 is series-connected between a battery 101 and a load102 and the current flowing in the low resistor 103 is converted into avoltage by a conversion circuit 104. On the other hand, a referencevoltage is generated from a reference voltage generating circuit 105.The converted voltage is compared with the reference voltage by acomparator circuit 106 so that a judgment is made as to whether thecurrent flowing in the low resistor 103 is abnormal or not.

[0007] Incidentally, the reference voltage generating circuit 105generated such a reference voltage with the earth as reference. Hence,it was necessary that a voltage drop over the low resistor 103 wasconverted into a value with reference to the earth by the conversioncircuit 104. It was however difficult that the voltage drop over the lowresistor 103 was converted accurately into a value with reference to theearth by the conversion circuit 104. Moreover, there was a problem thatthe configuration of the conversion circuit 104 became complex.

[0008] In addition, a battery voltage in a car varies relatively largelyeven in the case where the battery operates normally. To make itpossible to generate a constant reference voltage regardless of thevariation of the battery voltage, there was another problem that thecircuit configuration of the reference voltage generating circuit 105became complex.

SUMMARY OF THE INVENTION

[0009] The present invention is devised to solve the aforementionedproblems and an object of the present invention is to provide a currentdetecting circuit in which a load current supplied from a power supplyportion to a load can be detected by a simple circuit configuration.

[0010] According to the present invention, in a current supply circuitfor supplying a load current from a power supply portion to a load whenswitching means interposed between the power supply portion and the loadis turned on, there is provided a current detecting circuit constitutedby: a voltage generating circuit for generating and outputting a secondvoltage which is lower by a predetermined voltage value than a firstvoltage outputted from the power supply portion; a current detectingresistor interposed between the power supply portion and the load andhaving a predetermined resistance value; an analog-digital conversioncircuit which operates on the basis of a potential difference betweenthe first voltage and the second voltage to thereby convert an analogvalue into a k-bit (k is an integer not smaller than 2) digital value;and an arithmetic circuit for calculating the load current or a valuecorresponding to the load current on the basis of digital values whichare obtained by analog-digital conversion of voltages respectively onone and the other ends of the current detecting resistor by theanalog-digital conversion circuit when the switching means is turned on.

[0011] According to this configuration, the second voltage lower by thepredetermined voltage value than the first voltage outputted from thepower supply portion is generated and outputted from the voltagegenerating circuit so that the analog-digital conversion circuit isoperated by the potential difference between the first voltage and thesecond voltage.

[0012] When the switching means is turned on, the voltage on one end ofthe current detecting resistor and the voltage on the other end of thecurrent detecting resistor are converted into k-bit digital valuesrespectively by the analog-digital conversion circuit. The load currentor a value corresponding to the load current, for example, the voltagedrop over the current detecting resistor, is calculated on the basis ofresults of the conversion.

[0013] The analog-digital conversion circuit is operated by thepotential difference between the first voltage and the second voltagelower by the predetermined voltage value than the first voltage asdescribed above. By serving the second voltage as a virtual earthvoltage for the analog-digital conversion circuit, it is unnecessary toconvert the first and second voltages into values with reference to theactual earth. Hence, the load current or a value corresponding to theload current can be calculated by a simple configuration.

[0014] Further, in accordance with this configuration, detection of theload current can be made accurately. For example, the predeterminedvoltage is 5 V under the condition of k=8, the resolution of the digitalvalue is 5 V/255 which is near to 20 mV (5 V/255≈20 mV). That is, whenthe numerical value k is changed, detection of the load current can bemade with accuracy of a desired degree.

[0015] Further, the analog-digital conversion circuit may include: adivisional voltage output circuit for successively selectivelyoutputting summation values which are obtained by adding the secondvoltage to various voltage values which are obtained by multiplying adivisional voltage by m (m is an integer of from 0 to (n-1)), thedivisional voltage being obtained by dividing a potential differencebetween the first voltage and the second voltage into (n-1) parts (n isan integer satisfying n=2^(k)), and a comparator circuit for comparingthe voltage on the one end of the current detecting resistor with eachof the summation values which are successively selectively outputtedfrom the divisional voltage output circuit and for comparing the voltageon the other end of the current detecting resistor with each of thesummation values which are successively selectively outputted from thedivisional voltage output circuit; and the arithmetic circuit maycalculate the load current or a value corresponding to the load currenton the basis of results of the comparison in the comparator circuit.

[0016] According to this configuration, by use of the divisional voltageoutput circuit, the potential difference between the first voltage andthe second voltage is divided into (n-1) parts (n is an integersatisfying n=2^(k)) to obtain divisional voltages. Voltages are obtainedby multiplying the divisional voltage by a factor m (m is an integer offrom 0 to (n-1)). Summation values obtained by adding the second voltageto the multiplied voltages respectively are successively selectivelyoutput. For example, the divisional voltage output circuit is configuredto have (n-1) resistors each of which has an equal resistance value andwhich are series-connected between the output line of the power supplyportion and the output line of the voltage generating circuit.

[0017] Further, when the switching means is turned on, the voltage onone end of the current detecting resistor is compared with each of thesummation values successively selectively output. The voltage on theother end of the current detecting resistor is also compared with eachof the summation values successively selectively output. A load currentor a value corresponding to the load current, for example, a voltagedrop over the current detecting resistor, is calculated on the basis ofresults of the comparison.

[0018] In this manner, each of the summation values obtained by addingthe second voltage, which is lower by the predetermined voltage valuethan the first voltage, to a voltage obtained by multiplying thedivisional voltage by a factor m is used as a reference voltage. Each ofthe voltage on one end of the current detecting resistor and the voltageon the other end of the current detecting resistor is compared with thereference voltage. Hence, because the second voltage serves as a virtualearth voltage, the voltages on the opposite ends of the currentdetecting resistor need not be converted into values with reference tothe actual earth. Hence, the load current or a value corresponding tothe load current can be calculated by a simple configuration.

[0019] Further, the arithmetic circuit may calculates so that, as aresult of comparison by the comparator circuit, when sizes of thevoltage on the one end of the current detecting resistor and each of thesuccessively selectively outputted summation values are changed overeach other, the summation value at that time is made to be the voltagevalue on the one end, while, when sizes of the voltage on the other endof the current detecting resistor and each of the successivelyselectively outputted summation values are changed over each other, thesummation value at that time is made to be the voltage value on theother end, and, on the basis of a difference between the voltage valueson the one and the other ends of the current detecting resistor, avoltage drop over the current detecting resistor is obtained.

[0020] According to this configuration, in the results of the comparisonby the comparator circuit, when the sizes of the voltage on one end ofthe current detecting resistor and each of the summation valuessuccessively selectively outputted from the divisional voltage outputcircuit are changed over each other, the summation value is made to bethe voltage value on one end of the current detecting resistor. When thesizes of the voltage on the other end of the current detecting resistorand each of the summation values successively selectively outputted fromthe divisional voltage output circuit are changed over each other, thesummation value is made to be the voltage value on the other end of thecurrent detecting resistor. A voltage drop over the current detectingresistor can be calculated on the basis of the potential differencebetween the voltage value on one end of the current detecting resistorand the voltage value on the other end of the current detectingresistor. Hence, the voltage drop can be detected with resolution ofpredetermined voltage/(n-1). Hence, when the numerical value n is takenlarge, the voltage drop can be detected accurately.

[0021] Further, the analog-digital conversion circuit may form a part ofa CPU integrated on a semiconductor wafer, the CPU may have apower-supply input terminal and a ground terminal, and the first voltagemay be applied to the power-supply input terminal and the second voltagemay be applied to the ground terminal.

[0022] According to this configuration, the first voltage outputted fromthe power supply portion is applied to the power-supply input terminalof the CPU and the second voltage outputted from the voltage generatingcircuit is applied to the ground terminal of the CPU. Hence, the CPUoperates with an operating voltage which is a predetermined voltage (forexample, 5 V) to be the potential difference between the first voltageand the second voltage while the second voltage is used as a virtualearth voltage. Hence, the voltage drop over the current detectingresistor can be calculated accurately by a simple configuration.

[0023] Further, the current detecting resistor is formed from asemiconductor switching device constituting the switching means. If thepredetermined resistance value is the resistance value of the ON-stateresistance generated when the semiconductor switching device is turnedon, the semiconductor switching device such as an FET can serve also asa current detecting resistor. Hence, the current detecting resistor neednot be provided as a separate resistor, so that the circuitconfiguration can be simplified more greatly.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024]FIG. 1 is a circuit diagram showing an embodiment of a currentsupply circuit provided with a current detecting circuit according tothe present invention.

[0025]FIG. 2 is a circuit diagram showing an example of the virtualearth generating circuit.

[0026]FIG. 3 is a block diagram showing the A/D conversion portion inthe inside of the CPU.

[0027]FIG. 4 is a circuit diagram showing a modified embodiment of thecurrent supply circuit.

[0028]FIG. 5 is a block diagram showing another example of theconfiguration of the A/D conversion portion.

[0029]FIG. 6 is a timing chart for explaining the operation of the A/Dconversion portion depicted in FIG. 5.

[0030]FIG. 7 is a circuit diagram showing an example of a background-artcurrent detecting circuit.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0031] Now, a description will be given in more detail of preferredembodiments of the invention with reference to the accompanyingdrawings.

[0032]FIG. 1 is a circuit diagram showing an embodiment of a currentsupply circuit provided with a current detecting circuit according tothe present invention and showing an example of a current supply circuitfor car.

[0033] The current supply circuit is constituted by an on-vehiclebattery 1, an FET 2, a current detecting resistor 3, a load 4, a CPU 5,a drive circuit 6, and a virtual earth generating circuit 7. The FET 2,the current detecting resistor 3 and the load 4 are series-connected toeach other between the on-vehicle battery 1 and the earth. When thedrive circuit 6 applies a drive voltage onto a gate of the FET 2 inaccordance with a control signal issued from the CPU 5, the FET 2 isturned on so that the on-vehicle battery 1 supplies a load currentI_(LD) to the load 4.

[0034] In FIG. 1, the on-vehicle battery 1 outputs a battery voltageV_(BT) (for example, V_(BT)=12 V in this embodiment) to an output line11. The virtual earth generating circuit 7 generates a low voltageV_(SS) lower by a predetermined potential difference (for example, 5 Vin this embodiment) than the battery voltage V_(BT) and outputs the lowvoltage V_(SS) to an output line 71. The configuration of the virtualearth generating circuit 7 will be described later.

[0035] The CPU 5 has a power supply input terminal 51, a ground terminal52, A/D conversion input terminals 53 and 54 and an output terminal 55,as input-output terminals; and has an A/D conversion portion 60 as afunctional block.

[0036] The power supply input terminal 51 is connected to the outputline 11 of the on-vehicle battery 1. The ground terminal 52 is connectedto the output line 71 of the virtual earth generating circuit 7. Hence,the CPU 5 operates while the low voltage V_(SS) outputted to the outputline 71 of the virtual earth generating circuit 7 is used as a virtualearth potential and the battery voltage V_(BT) higher by a predeterminedpotential difference (5 V) than the low voltage V_(SS) is used as apower supply.

[0037] That is, a general CPU with an operating voltage of 5 V operatesbetween a power-supply voltage V_(DD) of 5 V and an earth potential of 0V whereas the CPU 5 in this embodiment is provided so that the potentialdifference applied to the device itself is the same as that applied tothe general CPU and the operating voltage of the CPU 5 is the same asthat of the general CPU but the absolute value of the voltage applied tothe CPU 5 is higher than that applied to the general CPU.

[0038] Further, the A/D conversion input terminals 53 and 54 of the CPU5 are connected to the on-vehicle battery 1 side of the currentdetecting resistor 3 and to the load 4 side of the current detectingresistor 3 respectively. The output terminal 55 of the CPU 5 isconnected to the drive circuit 6. The A/D conversion portion 60 of theCPU 5 is provided so that analog input voltage signals inputted to theA/D conversion input terminals 53 and 54 are converted into digitalvalues respectively. The configuration of the A/D conversion portion 60will be described later.

[0039] The CPU 5 has the following functions:

[0040] (1) a function of switching control means for turning on the FET2 by sending a control signal to the drive circuit 6 when an operationswitch (not shown) connected to an input terminal (not shown) is turnedon; and

[0041] (2) a function of arithmetic means for calculating a load currentI_(LD) on the basis of the on-vehicle battery 1 side voltage and theload 4 side voltage of the current detecting resistor 3 which aredetected by the A/D conversion portion 60 and which are inputted to theA/D conversion input terminals 53 and 54 and on the basis of theresistance value of the current detecting resistor 3.

[0042]FIG. 2 is a circuit diagram showing an example of a configurationof the virtual earth generating circuit. In FIG. 2, a diode D1 has acathode connected to the output line 11 of the on-vehicle battery 1, andan anode connected to a base of an NPN transistor Q1 and groundedthrough a resistor R1. The diode D1 and the resistor R1 constitute abias voltage generating circuit. The transistor Q1 functions as aconstant-current source.

[0043] The transistor Q1 has an emitter grounded, and a collectorconnected to a collector of a PNP transistor Q2 and connected to a baseof the transistor Q2 through a resistor R2. The transistor Q2 has thebase connected to an anode of a Zener diode Z1. The Zener diode Z1 has acathode connected to the output line 11 of the on-vehicle battery 1. Acapacitor Cl is connected in parallel with the Zener diode Z1.

[0044] The transistor Q2 has an emitter connected to the output line 11of the on-vehicle battery 1 through a resistor R3 and connected to theground terminal 52 of the CPU 5 through the output line 71.

[0045] The a forementioned configuration satisfies the followingexpression:

V_(SS)=V_(BT)−V_(ZD)+V_(BE)(Q2)

[0046] in which V_(ZD) is a Zener voltage of the Zener diode Z1, andV_(BE)(Q2) is a base-emitter voltage of the transistor Q2.

[0047] Hence, because the base-emitter voltage V_(BE)(Q2) is about 0.6 V(V_(BE)(Q2)≈0.6 V), a circuit for generating a low voltageV_(SS)=V_(BT)−5 V can be achieved when a Zener diode with a Zenervoltage V_(ZD) of about 5.6 V (V_(ZD)≈5.6 V) is used.

[0048]FIG. 3 is a block diagram showing an example of a configuration ofthe A/D conversion portion 60 of the CPU 5. The A/D conversion portion60 has a known circuit configuration for performing 8-bit A/Dconversion.

[0049] In FIG. 3, a selector 61 outputs an analog input voltage signalfrom selected one of the A/D conversion input terminals 53 and 54 to asample-and-hold circuit 63 in accordance with the content of an inputselection register 62. The sample-and-hold circuit 63 samples the analoginput voltage signal given through the selector 61 and sends the sampledanalog input voltage signal to a voltage comparator 64. Thesample-and-hold circuit 63 holds the sampled analog input voltage signaluntil the A/D conversion is completed.

[0050] A divisional voltage output circuit 65 has (2⁸- 1), that is, 255resistors 651, 651, . . . which have the same resistance value with oneanother and which are series-connected between the output line 11(power-supply voltage V_(BT)) and the output line 71 (low voltageV_(SS)). The divisional voltage output circuit 65 further has a selector652 for successively selecting connection of the voltage comparator 64to respective junction points (254 points in total) between theresistors 651 and the output lines 11 and 71. The selection is based ona control signal issued from a control circuit 66. By this selection,values obtained by adding the low voltage V_(SS) to voltages obtained bymultiplying the voltage (V_(BT)−V_(SS))=5 V by each factor of 255/255=1, 254/255, . . . , 2/255, 1/255 and 0 are successively outputted tothe voltage comparator 64. When, for example, the multiplication factoris 1, the voltage V_(BT) is outputted to the voltage comparator 64.When, for example, the multiplication factor is 0, the voltage V_(SS) isoutputted to the voltage comparator 64.

[0051] The voltage comparator 64 sequentially compares the analog inputvoltage signal V_(SP) which is given from the sample-and-hold circuit63, with an analog reference voltage V_(RF) which is given from thedivisional voltage output circuit 65, and sends a digital signal to an8-bit sequential conversion register 67 in accordance with a result ofthe comparison. The sequential conversion register 67 holds thecomparison result as a digital value.

[0052] The bit operation of the sequential conversion register 67 isperformed by the control circuit 66 in synchronism with the selection byin the selector 652. When an operation of storing one bit into thesequential conversion register 67 is completed, the sequentialconversion register 67 sends a signal to the control circuit 66 toinform the control circuit 66 of the completion of one-bit storage.

[0053] A conversion result register 68 is constituted by an 8-bitregister for holding a result of A/D conversion of the analog inputvoltage signal V_(SP). The input selection register 62 and theconversion result register 68 are connected to an ALU (arithmetic logicunit not shown) or the like through an internal bus 69.

[0054] An example of the operation of the CPU 5 will be described below.A reference voltage V_(RF), which is a summation value obtained byadding the low voltage V_(SS) to each voltage obtained by multiplyingthe voltage (V_(BT)-V_(SS))=5 V by a factor such as 255/255 =1, 254/255,. . . , 2/255, 1/255 or 0, is successively outputted from the divisionalvoltage output circuit 65 to the voltage comparator 64. In the voltagecomparator 64, the analog input voltage signal V_(SP) is compared withthe reference voltage V_(RF). If V_(SP)<V_(RF), a “0” signal is sent tothe sequential conversion register 67. If V_(RF)<V_(SP), a “1” signal issent to the sequential conversion register 67. The sequential conversionregister 67 holds a result of the comparison.

[0055] That is, as the bit contents, the sequential conversion register67, for example, takes a value of “11111111” in the case ofV_(BT)≦V_(SP), takes a value of “11101011” in the case of(V_(BT)−V_(SS))·235/255+V_(SS)≦V_(SP)<(V_(BT)−V_(SS))·236/255+V_(SS),and takes a value of “00000000” in the case ofV_(SS)≦V_(SP)<(V_(BT)−V_(SS))·1/255 +V_(SS).

[0056] In this manner, the analog input voltage signal V_(SP) iscompared with the reference voltage V_(RF) outputted successively.Whenever the sizes of the analog input voltage signal V_(SP) and thereference voltage V_(RF) are changed over each other, the sequentialconversion register 67 holds the reference voltage V_(RF) as a voltagevalue at that point of time and sends the reference voltage V_(RF) tothe conversion result register 68. The content held in the conversionresult register 68 is once stored in an RAM (not shown) contained in theCPU 5. Hence, the on-vehicle battery 1 side voltage value and the load 4side voltage value of the current detecting resistor 3 are calculated asdigital values respectively and stored in the RAM.

[0057] Then, the load 4 side voltage value of the current detectingresistor 3 is subtracted from the on-vehicle 1 side voltage value of thecurrent detecting resistor 3. A result of the subtraction is divided bythe resistance value of the current detecting resistor 3 to therebycalculate a load current I_(LD).

[0058] As described above, in accordance with this embodiment, the CPU 5with an operating voltage of 5 V is operated while the low voltageV_(SS)=V_(BT)−5 V is used as a virtual earth potential and the batteryvoltage V_(BT) as a power-supply potential. Hence, because an earthpotential of 0 V is not used as a reference, the background-artconversion circuit as shown in FIG. 7 need not be provided. Hence, theon-vehicle battery 1 side voltage and the load 4 side voltage of thecurrent detecting resistor 3 can be detected by a simple circuitconfiguration. Hence, the load current I_(LD) can be detected on thebasis of the difference between the aforementioned voltages and theresistance value of the current detecting resistor 3.

[0059] Because (V_(BT)−V_(SS)) is kept constant (5 V) even in the casewhere the battery voltage V_(BT) varies, the load current I_(LD) can bedetected accurately regardless of the variation of the battery voltageV_(BT.)

[0060] Further, because the on-vehicle battery 1 side voltage and theload 4 side voltage of the current detecting resistor 3 are detected bythe A/D conversion portion 60 of the CPU 5, each of the above-mentionedvoltages can be detected with accuracy of a high degree of about 20 mVif, for example, the A/D conversion portion 60 has 8 bits. Hence, theload current I_(LD) can be detected accurately.

[0061] In this case, the resistance value of the current detectingresistor 3 may be preferably selected while the level of the loadcurrent I_(LD) is taken into account, so that the load 4 side voltage ofthe current detecting resistor 3 takes an intermediate value between thebattery voltage V_(BT) and the low voltage V_(SS).

[0062] The variation in characteristic of devices in an IC formed on asemiconductor wafer will be described below in order to describe thevariation in resistance value of the resistors 651, . . . of thedivisional voltage output circuit 65 in the A/D conversion portion 60 ofthe CPU 5.

[0063] Each IC is produced by the steps of: forming a large number ofequal circuits on a wafer cut out of an ingot of semiconductor(generally, silicon) by a known circuit-forming process; dicing thewafer into circuits (chips); and molding each circuit (chip) Hence, thevariation in characteristic of devices in the IC can be classified intovariation generated among chips in one wafer, variation among wafers andvariation among ingots from which wafers are cut.

[0064] The variation in characteristic of devices in the IC is generatedby variation in the circuit-forming process, that is, by factors such asvariation in an etching step, variation in an exposure step, variationin diffusing power in an impurities diffusing step, variation intemperature in each step, and so on.

[0065] Among the aforementioned steps, the etching, exposure andimpurities diffusing steps which are factors of the variation arecarried out wafer by wafer. On one and the same wafer, temperature canbe kept the same in the respective steps. Hence, variation incharacteristic hardly occurs among chips in one wafer. Particularlyvariation among devices formed near to one another in one chip can bealmost neglected.

[0066] Hence, relative variation in resistance value of the resistors651, . . . can be made on a very low level. Hence, the A/D conversion ofthe analog input voltage signal V_(SP) can be made accurately by the A/Dconversion portion 60 of the CPU 5. Accordingly, the load current I_(LD)can be detected accurately.

[0067] Incidentally, the present invention is not limited to theaforementioned embodiment and the following modifications may be made.

[0068] (1) Although the aforementioned embodiment has shown the casewhere the current detecting resistor 3 is series-connected between theon-vehicle battery 1 and the load 4, the present invention is notlimited thereto.

[0069] In FIG. 4, the A/D conversion input terminals 53 and 54 of theCPU 5 are connected to a drain of an FET 2 and a source of the FET 2respectively. The FET 2 serves also as a current detecting resistor. Inthis case, the load current I_(LD) can be detected in the same manner asthat in the aforementioned embodiment if the ON-state resistance of theFET 2 is measured in advance.

[0070] According to the embodiment shown in FIG. 4, the circuitconfiguration can be simplified more greatly because the currentdetecting resistor 3 is dispensed with.

[0071] (2) The circuit configuration of the virtual earth generatingcircuit 7 and the circuit configuration of the A/D conversion portion 60are not limited to the examples shown FIGS. 2 and 3 respectively andother circuit configurations may be used.

[0072] (3) Although the aforementioned embodiment has shown the casewhere the A/D conversion portion 60 performs 8-bit A/D conversion, thepresent invention is not limited thereto. For example, in the case of10-bit A/D conversion, the load current can be detected more accurately.

[0073] Incidentally, in the case of k-bit A/D conversion, the divisionalvoltage output circuit 65 shown in FIG. 3 may preferably have nresistors 651 in which n is equal to (2^(k−)1)

[0074] (4) Although the aforementioned embodiment has shown the casewhere values obtained by adding the low voltage V_(SS) to voltagesobtained by multiplying the voltage (V_(BT)−V_(SS))=5 V by each factorof 255/255 =1, 254/255, . . . , 2/255, 1/255 and 0 are successivelyoutputted from the selector 652 of the divisional voltage output circuit65 to the voltage comparator 64, the output order is not limitedthereto. In reverse order, values obtained by adding the low voltageV_(SS) to voltages obtained by multiplying the voltage (V_(BT)−V_(SS))=5V by each factor of 0, 1/255, 2/255, . . . , 254/255 and 255/255 1 maybe successively outputted to the voltage comparator 64.

[0075] (5) Although FIGS. 1 and 4 show the case where the load 4 isconstituted by a lamp, the present invention is not limited thereto. Forexample, the load 4 may be constituted by a secondary battery. In thiscase, the charging current as a load current supplied from theon-vehicle battery 1 to the secondary battery can be detectedaccurately.

[0076] (6) Although the aforementioned embodiment has shown the casewhere the A/D conversion portion 60 is contained in the CPU 5, thepresent invention is not limited thereto and the A/D conversion portion60 may be provided as a separate circuit to be externally attached tothe CPU 5. Further, the circuit configuration of the A/D conversionportion 60 is not limited to the example shown in FIG. 3.

[0077]FIG. 5 is a block diagram showing another example of theconfiguration of the A/D conversion portion. FIG. 6 is a timing chartfor explaining the operation of the A/D conversion portion depicted inFIG. 5.

[0078] The A/D conversion portion 60 depicted in FIG. 5 is constitutedby a known double-integral type A/D conversion circuit, which isexternally attached to the CPU 5.

[0079] In FIG. 5, a selector 80 selectively connects one end (forexample, battery side) and the other end (for example, load side) of thecurrent detecting resistor 3 to the A/D conversion portion 60. Theselection of connection is controlled by the CPU 5.

[0080] A negative voltage generating circuit 81 in the A/D conversionportion 60 generates a reference voltage V_(REF) lower by apredetermined voltage value than the low voltage V_(SS). A selector 82has a switch S1 connected to the selector 80, and a switch S2 connectedto the negative voltage generating circuit 81. The ON/OFF of theswitches S1 and S2 is controlled by a logic circuit 83.

[0081] A resistor R11, a capacitor C11 and an operational amplifier 84constitute an integrating circuit (the operation of which will bedescribed later). A comparator 85 compares the low voltage V_(SS) with avoltage V₈₄ outputted from the operational amplifier 84. WhenV₈₄=V_(SS), the comparator 85 outputs a predetermined detection signal.The logic circuit 83 has a function of controlling the switching-over ofthe selector 82 on the basis of a count value of a counter 86, afunction of resetting the count value of the counter 86, and so on.

[0082] The counter 86 counts the number of pulses generated by a clockpulse signal generating circuit 87. When, for example, the counter 86counts 1000 pulses in the case where a pulse signal with 10 kHz isgenerated by the clock pulse signal generating circuit 87, the elapsedtime is 0.1 sec.

[0083] The operation of the A/D conversion portion in FIG. 5 will bedescribed below with reference to FIG. 6 which is a timing chart.Incidentally, also in the circuit shown in FIG. 5, the low voltageV_(SS) serves as a virtual earth in the same manner as that in theaforementioned embodiment.

[0084] In FIG. 6, in the case of V₈₄=V_(SS) (at the point of time t1), adetection signal is outputted from the comparator 85. The logic circuit83 turns on the switch S1 on the basis of the detection signal, so thatthe voltage Ei measured at one end of the current detecting resistor 3is inputted to the integrating circuit through the selector 80.

[0085] The voltage V₈₄ outputted from the operational amplifier 84 riseslinearly in a negative direction because the measured voltage Ei is apositive voltage relative to the low voltage V_(SS). On this occasion,the inclination of the line is proportional to the size of the measuredvoltage Ei.

[0086] The ON-state time T1 of the switch S1 is determined to be apredetermined value (for example, 0.1 sec) in advance. When the countvalue of the counter 86 reaches the predetermined value, the switch S1is turned off by the logic circuit 83 (at the point of time t2). Hence,when the switch S1 is turned off, the output voltage V₈₄ is proportionalto the size of the measured voltage Ei.

[0087] At the same time that the switch S1 is turned off, the switch S2is turned on by the logic circuit 83 and the count value of the counter86 is reset. When the switch S2 is turned on, the reference voltageV_(REF) is inputted from the negative voltage generating circuit 81 tothe integrating circuit. The voltage V₈₄ outputted from the operationalamplifier 84 rises linearly in a positive direction because thereference voltage V_(REF) is a negative voltage relative to the lowvoltage V_(SS).

[0088] When the output voltage V₈₄ further rises and reaches V_(SS)(V₈₄=V_(SS)) after time T2, the comparator 85 outputs a detectionsignal. The logic circuit 83 turns off the switch S2 on the basis of thedetection signal and the counting operation of the counter 86 isstopped.

[0089] When the output voltage V₈₄ rises linearly in a positivedirection, the inclination of the line is proportional to the size ofthe reference voltage V_(REF). That is, the inclination is alwaysconstant because the reference voltage V_(REF) is constant. Because thetime T1 and the reference voltage V_(REF) are given and the time T2 isproportional to the measured voltage Ei, the count value of the counter86 at the point of time after the time T2 passed is obtained as adigital value of the measured voltage Ei. The digital value of themeasured voltage Ei is stored in the RAM of the CPU 5.

[0090] Hence, when the selector 80 is switched over by the CPU 5,voltages at one end and the other end of the current detecting resistor3 can be obtained as digital values.

[0091] Hence, a voltage drop over the current detecting resistor 3 canbe calculated by the CPU 5 in the same manner as that in theaforementioned embodiment. Thus, the same effects as in theaforementioned embodiment can be obtained.

[0092] As described above, in accordance with the present invention, asecond voltage lower by a predetermined voltage value than a firstvoltage outputted from a power supply portion is generated and outputtedto there by operate an analog-digital conversion circuit on the basis ofthe potential difference between the first voltage and the secondvoltage. When switching means is turned on, a voltage at one end of acurrent detecting resistor and a voltage at the other end of the currentdetecting resistor are converted into k-bit digital values respectivelyby the analog-digital conversion circuit. A load current or a valuecorresponding to the load current is calculated on the basis of theresults of the conversion. Hence, the voltages on both the ends of thecurrent detecting resistor need not be converted into values withreference to the earth, so that the load current or a valuecorresponding to the load current can be calculated by a simpleconfiguration. Moreover, when the numerical value k is changed,detection of the load current can be made with accuracy of a desireddegree.

[0093] Further, the potential difference between the first voltage andthe second voltage is divided into (n-1) parts to obtain divisionalvoltages. Voltages are obtained by multiplying the divided voltage by afactor m. Summation values obtained by adding the second voltage to themultiplied voltages respectively are successively and selectivelyoutput. The voltage on one end of the current detecting resistor iscompared with each of the summation values successively selectivelyoutput. The voltage on the other end of the current detecting resistoris compared with each of the summation values. A load current or a valuecorresponding to the load current is obtained on the basis of results ofthe comparison. Hence, the voltages on both the ends of the currentdetecting resistor need not be converted into values with reference tothe earth. Hence, the load current or a value corresponding to the loadcurrent can be calculated by a simple configuration.

[0094] Further, in the results of the comparison by the comparatorcircuit, when the sizes of the voltage on one end of the currentdetecting resistor and one of the summation values successivelyselectively outputted are changed over each other, the summation valueis made to be the voltage value on one end of the current detectingresistor. When the sizes of the voltage on the other end of the currentdetecting resistor and one of the summation values successivelyselectively outputted are changed over each other, the summation valueis made to be the voltage value on the other end of the currentdetecting resistor. By calculating a voltage drop over the currentdetecting resistor on the basis of the difference between the voltagevalue on one end of the current detecting resistor and the voltage valueon the other end of the current detecting resistor, the voltage drop isdetected with resolution of predetermined voltage/(n-1). Hence, when thenumerical value n is taken large, the voltage drop can be detectedaccurately.

[0095] Further, the analog-digital conversion circuit forms a part ofthe CPU integrated on a semiconductor wafer. When the first voltage isapplied to the power-supply input terminal of the CPU and the secondvoltage is applied to the ground terminal of the CPU, the CPU operateswith an operating voltage which is a predetermined voltage to be thepotential difference between the first voltage and the second voltagewhile the second voltage is used as a reference virtual earth. Hence,the voltage drop over the current detecting resistor can be calculatedaccurately by a simple configuration.

[0096] Further, when the current detecting resistor is constituted by asemiconductor switching device constituting switching means so that thepredetermined resistance value is the resistance value of the ON-stateresistance generated when the semiconductor switching device is turnedon, the semiconductor switching device can serve also as a currentdetecting resistor. Hence, the current detecting resistor need not beprovided as a separate resistor, so that the circuit configuration canbe simplified more greatly.

What is claimed is:
 1. A current detecting circuit for use in a currentsupply circuit for supplying a load current from a power supply portionto a load when switching means interposed between said power supplyportion and said load is turned on, said current detecting circuitcomprising: a voltage generating circuit for generating and outputting asecond voltage which is lower by a predetermined voltage value than afirst voltage outputted from said power supply portion; a currentdetecting resistor interposed between said power supply portion and saidload and having a predetermined resistance value; an analog-digitalconversion circuit which operates on the basis of a potential differencebetween said first voltage and said second voltage to thereby convert ananalog value into a k-bit (k is an integer not smaller than 2) digitalvalue; and an arithmetic circuit for calculating said load current or avalue corresponding to said load current on the basis of digital valueswhich are obtained by analog-digital conversion of voltages respectivelyon one and the other ends of said current detecting resistor by saidanalog-digital conversion circuit when said switching means is turnedon.
 2. A current detecting circuit according to claim 1, wherein saidanalog-digital conversion circuit comprises: a divisional voltage outputcircuit for successively selectively outputting summation values whichare obtained by adding said second voltage to various voltage valueswhich are obtained by multiplying a divisional voltage by m (m is aninteger of from 0 to (n-1)), said divisional voltage being obtained bydividing a potential difference between said first voltage and saidsecond voltage into (n-1) parts (n is an integer satisfying n=2^(k)),and a comparator circuit for comparing said voltage on said one end ofsaid current detecting resistor with each of said summation values whichare successively selectively outputted from said divisional voltageoutput circuit and for comparing said voltage on the other end of saidcurrent detecting resistor with each of said summation values which aresuccessively selectively outputted from said divisional voltage outputcircuit; and said arithmetic circuit calculating said load current or avalue corresponding to said load current on the basis of results of saidcomparison in said comparator circuit.
 3. A current detecting circuitaccording to claim 2, wherein said arithmetic circuit calculates sothat, as a result of comparison by said comparator circuit, when sizesof said voltage on said one end of said current detecting resistor andeach of said successively selectively outputted summation values arechanged over each other, the summation value at that time is made to bethe voltage value on said one end, while, when sizes of said voltage onsaid other end of said current detecting resistor and each of saidsuccessively selectively outputted summation values are changed overeach other, the summation value at that time is made to be the voltagevalue on said other end, and wherein, on the basis of a differencebetween said voltage values on said one and the other ends of saidcurrent detecting resistor, a voltage drop over said current detectingresistor is obtained.
 4. A current detecting circuit according to claim1, wherein said analog-digital conversion circuit forms a part of a CPUintegrated on a semiconductor wafer; wherein said CPU has a power-supplyinput terminal and a ground terminal; and wherein said first voltage isapplied to said power-supply input terminal and said second voltage isapplied to said ground terminal.
 5. A current detecting circuitaccording to claim 1, wherein said current detecting resistor is formedfrom a semiconductor switching device constituting said switching means;and said predetermined resistance value is a resistance value ofON-state resistance generated when said semiconductor switching deviceis turned on.